<template>
	<view>
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">调岗申请表</block>

			<block slot="right">
				<image  class="nav-right-image" src="@/static/icon/next.png"></image>
			</block>
			<block slot="right">
				<image  class="nav-right-image" src="@/static/icon/next.png"></image>
			</block>
		</cu-custom>

		<view class="page-content" :style="{ height: this.ContentArea + 'px', paddingTop: '30rpx' }">
			<view class="page-search">
				<view class="search">
					<view class="search-left">
						<image src="@/static/images/search.png" mode="aspectFit" />
					</view>
					<input class="search-center" type="text" placeholder="搜索名字/工号" placeholder-class="search-placeholder"
						v-model="searchValue">
				</view>
				<view class="filter-btn" @click="onRefresh">
					<image src="@/static/images/filter.png" mode="aspectFit" />
				</view>
			</view>

			<view class="page-content-main">
				<view class="select-box">

					<view style="position: relative;">
            <uni-datetime-picker v-model="createTime" type="line">
              <view class="select">
                <view class="select-value">{{ createTimeShow }}</view>
                <view class="select-icon" v-if="createTime ==''">
                  <image src="@/static/images/downArrow.png" mode="aspectFit" />
                </view>
              </view>
            </uni-datetime-picker>
            <view class="cuIcon-roundclose" v-if="createTime !=''"
                  style="z-index: 9;width: 20px;height: 20px;position: absolute;right: 55rpx;top: 25rpx;color: #FFFFFF;"
                  @click="clearDatetimePicker">
            </view>
					</view>


					<view class="select">

						<my-select range-key="text" value-key="value" dict-code="approval_status"
							v-model="approvalStatus" />

						<view class="select-icon">
							<image src="@/static/images/downArrow.png" mode="aspectFit" />
						</view>
					</view>
				</view>


				<scroll-view class="list" :scroll-y='true' :refresher-enabled="true" :refresher-triggered="refreshing"
					@refresherrefresh="onRefresh" :refresher-background="'#F9F9F9'" @scrolltolower="onEndReached">
					<view class="list-item" v-for="(item, index) in dataList" :key="index">
						<view class="list-item-left">
							<view class="person-name">刘晓燕</view>
						<view class="person-detail">
							<view class="person-detail-item">
								<img class="icon" src="../../static/icon/lou.png" alt="">
								<span>某某公司</span>
							</view>
							<view class="person-detail-item">
								<img class="icon" src="../../static/icon/lou.png" alt="">
								<span>车间部门</span>
							</view>
							<view class="person-detail-item">
								<img class="icon" src="../../static/icon/lou.png" alt="">
								<span>熟练工 </span>
							</view>
						</view>
						<view class="person-time">
							<view>转正日期：2023/10/10</view>
							<view>创建日期：2023/10/10</view>
						</view>
						</view>
						<view class="list-item-right">
							<img class="icon next" src="../../static/icon/next.png" alt="">
						</view>
					</view>


				</scroll-view>
			</view>

		</view>

	</view>
</template>

<script>
import moment from 'moment';
export default {
	data() {
		return {
			refreshing: true,
      createTime: moment().format('YYYY-MM-DD'),
			approvalStatus: '',
			searchValue: '',
			dataList: [{}, {}, {}, {}]
		}
	},
	mounted() {

	},
	computed: {
		createTimeShow: function() {
      return moment(this.createTime).isValid() ? moment(this.createTime).format('MM-DD') : '请选择'
			}
	},
	methods: {
    clearDatetimePicker() {
      this.createTime = ''
    }
	}
}
</script>

<style lang="scss" scoped>

.person-time {
	display: flex;
	width: 100%;
	justify-content: space-between;
	margin: 40rpx 0;
}

.person-name {
	width: 100%;
	text-align: left;
	margin: 40rpx 0;
}

.person-detail {
	margin: 40rpx 0;
	display: flex;
	width: 100%;

	.person-detail-item {
		width: 30%;
	}

}

.icon {
	width: 24rpx;
	margin-right: 10rpx;
	vertical-align: middle;
}
.next{
	width: 40rpx;
}

image {
	width: 100%;
	height: 100%;
}

.blackList {
	height: 100%;
	overflow: hidden;
}

.page-search {
	padding-left: 34rpx;
	margin-bottom: 12rpx;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
}

.search {
	width: 588rpx;
	height: 86rpx;
	background-color: rgba(249, 249, 249, 1);
	border-radius: 60rpx;
	display: flex;
	flex-direction: row;
	align-items: center;
	padding-left: 24rpx;
	padding-right: 24rpx;

	.search-left {
		width: 28rpx;
		height: 28rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.search-center {
		margin-left: 22rpx;
	}

	.search-placeholder {
		font-size: 28rpx;
		font-weight: 400;
		color: #7C7C7C;
	}


}

.filter-btn {
	width: 40rpx;
	height: 40rpx;
	margin-right: 42rpx;
	display: flex;
	justify-content: center;
	align-items: center;
}

.page-content-main {
	// min-height: calc(100% - 12rpx - 86rpx);
	min-height: 90%;
	border-radius: 64rpx;
	background-color: #F9F9F9;
	padding: 26rpx 34rpx 0 34rpx
}

.select-box {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;

}

.select {
	width: 148rpx;
	height: 74rpx;
	border-radius: 60rpx;
	background-color: #4591FE;
	margin-bottom: 20rpx;
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	margin-right: 48rpx;
	position: relative;

  .select-value {
    font-size: 28rpx;
    font-weight: 400;
    color: #FFFFFF;
    margin-right: 18rpx;
  }

  .select-icon {
    width: 22rpx;
    height: 22rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    right: 20rpx;
    top:25rpx;
  }
}

.list {
	max-height: calc(100% - 74rpx - 20rpx);

	::v-deep {
		.uni-scroll-view-content {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			justify-content: flex-start;

		}
	}

}

.list-item {
	box-sizing: border-box;
	padding: 0 4%;
	background-color: #FFFFFF;
	border-radius: 40rpx;
	width: 100%;
	display: flex;
	// flex-direction: column;
	justify-content: center;
	align-items: center;
	margin: 20rpx 2rpx;
	box-shadow:  0px 0px 12px 1px #E4EFFa;
	.list-item-left{
		width: 90%;
		// background-color: rebeccapurple;
		padding: 0;
	}
	.list-item-right{
		width: 10%;
		text-align: center;
	}
}

.list-item:nth-child(odd) {
	margin-right: 0;
}

.nav-right-image {
	width: 40rpx;
	height: 40rpx;
	margin-left: 20rpx;
}

.fun-wrap {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(3, 3, 3, 0.28);
	z-index: 10000;
}

.fun-box {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: center;
	flex-wrap: wrap;
	width: 556rpx;
	height: 656rpx;
	border-top-left-radius: 42rpx;
	border-bottom-left-radius: 42rpx;
	border-bottom-right-radius: 42rpx;
	position: absolute;
	right: 74rpx;
	background-color: #FFFFFF;
}

.fun-item {
	width: 185rpx;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	margin-bottom: 44rpx;
}

.fun-icon {
	width: 92rpx;
	height: 92rpx;
	margin-bottom: 22rpx;
}

.cu-form-group {
	background-color: transparent;
}

::v-deep {
	.cu-form-group uni-picker .picker {
		color: #FFFFFF;
	}

	.cu-form-group uni-picker::after {
		opacity: 0;
	}
}</style>
